package com.gx.smart.building.ui.repair.common;

/**
 * @author: xiaosy
 * 时间: 2022/3/23
 * @Description: java类作用描述
 * @Version: 1.0
 **/
public class CommonHelper {

    /**
     * 状态：task_draft-未发布，task_assign-待指派，
     * task_receive-待接单，task_process-处理中，
     * task_review-待审核，task_complete-已完成，
     * task_suspend_review-待审批，task_suspend-挂起，
     * task_cancel-已撤销
     *
     * @return
     */
    public static String getStatus(String value) {
        String status = "";
        switch (value) {
            case "task_draft":
                status = "未发布";
                break;
            case "task_assign":
                status = "待指派";
                break;
            case "task_receive":
                status = "待接单";
                break;
            case "task_process":
                status = "处理中";
                break;
            case "task_suspend_review":
                status = "待审批";
                break;
            case "task_suspend":
                status = "挂起";
                break;
            case "task_review":
                status = "待审核";
                break;
            case "task_cancel":
                status = "已撤销";
                break;
            case "task_complete":
                status = "已完成";
                break;
        }
        return status;
    }


    /**
     * 工单创建
     * DRAFT_TASK("draft_task", "工单创建"),
     * <p>
     * 工单指派
     * ASSIGN_TASK("assign_task", "工单指派"),
     * <p>
     * 工单接收
     * RECEIVE_TASK("receive_task", "工单接收"),
     * <p>
     * 处理完成
     * PROCESS_TASK("process_task", "处理完成"),
     * <p>
     * 工单回退
     * BACK_TASK("back_task", "工单回退"),
     * <p>
     * 工单转派
     * FORWARD_TASK("forward_task", "工单转派"),
     * <p>
     * 工单挂起
     * SUSPEND_TASK("suspend_task", "工单挂起"),
     * <p>
     * 工单解挂
     * RESUME_TASK("resume_task", "工单解挂"),
     * <p>
     * 工单审核
     * REVIEW_TASK("review_task", "工单审核"),
     * <p>
     * 挂起审批
     * SUSPEND_REVIEW_TASK("suspend_review_task", "挂起审批"),
     * <p>
     * 工单撤销
     * CANCEL_TASK("cancel_task", "工单撤销");
     *
     * @return
     */
    public static String getCreatorByEventCode(String value) {
        String creator = "";
        switch (value) {
            case "draft_task":
                creator = "创建人";
                break;
            case "assign_task":
                creator = "指派人";
                break;
            case "receive_task":
                creator = "接单人";
                break;
            case "process_task":
                creator = "处理人";
                break;
            case "back_task":
                creator = "回退人";
                break;
            case "suspend_review_task":
                creator = "审批人";
                break;
            case "suspend_task":
                creator = "挂起人";
                break;
            case "review_task":
                creator = "审核人";
                break;
            case "forward_task":
                creator = "转派人";
                break;
            case "resume_task":
                creator = "解挂人";
                break;
            case "cancel_task":
                creator = "撤销人";
                break;
            case "evaluate_task":
                creator = "评价人";
                break;
            case "add_note_task":
            case "hasten_task":
                creator = "操作人";
                break;
        }
        return creator;
    }

}
